package server.xml;

public class ServerXml {
    //监听的关闭服务器端口号
    private int shutdownPort = 6689;
    //关闭服务器的指令字符串
    private String shutdownCmd = "SHUTDOWN";
    //服务端Socket监听的端口号
    private int serverPort = 6688;
    //连接器与客户端建立连接后读取数据的等待超时时间,超出时间断开连接
    //单位为毫秒,-1表示不超时
    private int connectionTimeout = 20000;
    //最大接受连接数,用于控制Socket中排队连接的最大个数,
    //当Socket排队连接到达acceptCount时,服务器将拒绝新的连接请求
    private int acceptCount = 100;
    //连接器管理的线程池中线程的最大数目,-1表示没有数量限制
    //这些线程用于处理http请求
    private int maxThreads = 200;
    //minThreads:启动服务器时线程池中的线程数
    private int minThreads = 20;
    //如果该属性为true,将监控/WEB-INF/classes和/WEB-INF/lib下文件的变更。
    //检测到变更时，自动重新加载Web应用。
    private boolean reloadable = false;
    //加载器多长时间检查一次文件是否变更,单位为秒。reloadable属性值为true时有用
    private int checkInterval = 15;

    public int getShutdownPort() {
        return shutdownPort;
    }

    public void setShutdownPort(int shutdownPort) {
        this.shutdownPort = shutdownPort;
    }

    public String getShutdownCmd() {
        return shutdownCmd;
    }

    public void setShutdownCmd(String shutdownCmd) {
        this.shutdownCmd = shutdownCmd;
    }

    public int getServerPort() {
        return serverPort;
    }

    public void setServerPort(int serverPort) {
        this.serverPort = serverPort;
    }

    public int getConnectionTimeout() {
        return connectionTimeout;
    }

    public void setConnectionTimeout(int connectionTimeout) {
        this.connectionTimeout = connectionTimeout;
    }

    public int getAcceptCount() {
        return acceptCount;
    }

    public void setAcceptCount(int acceptCount) {
        this.acceptCount = acceptCount;
    }

    public int getMaxThreads() {
        return maxThreads;
    }

    public void setMaxThreads(int maxThreads) {
        this.maxThreads = maxThreads;
    }

    public int getMinThreads() {
        return minThreads;
    }

    public void setMinThreads(int minThreads) {
        this.minThreads = minThreads;
    }

    public boolean isReloadable() {
        return reloadable;
    }

    public void setReloadable(boolean reloadable) {
        this.reloadable = reloadable;
    }

    public int getCheckInterval() {
        return checkInterval;
    }

    public void setCheckInterval(int checkInterval) {
        this.checkInterval = checkInterval;
    }

    @Override
    public String toString() {
        return "ServerXml{" +
                "shutdownPort=" + shutdownPort +
                ", shutdownCmd='" + shutdownCmd + '\'' +
                ", serverPort=" + serverPort +
                ", connectionTimeout=" + connectionTimeout +
                ", acceptCount=" + acceptCount +
                ", maxThreads=" + maxThreads +
                ", minThreads=" + minThreads +
                ", reloadable=" + reloadable +
                ", checkInterval=" + checkInterval +
                '}';
    }
}
